public class Session {
    private String id;
    private Movie movie;
    private Hall hall;
    private double price;
    private boolean[][] seats;

    public Session(String id, Movie movie, Hall hall, double price) {
        this.id = id;
        this.movie = movie;
        this.hall = hall;
        this.price = price;
        this.seats = new boolean[hall.getRowCount()][hall.getSeatPerRow()];
    }

    public boolean isSeatAvailable(int row, int seat) {
        return !seats[row - 1][seat - 1];
    }

    public boolean lockSeat(int row, int seat) {
        if (isSeatAvailable(row, seat)) {
            seats[row - 1][seat - 1] = true;
            return true;
        }
        return false;
    }

    public void unlockSeat(int row, int seat) {
        seats[row - 1][seat - 1] = false;
    }

    public String getId() { return id; }
    public Movie getMovie() { return movie; }
    public Hall getHall() { return hall; }
    public double getPrice() { return price; }
}
